import { getGlobalEnv } from "@/utils/constants";
import { createAxios, ZAxiosOption } from "@/utils/http";

const { baseApiUrl } = getGlobalEnv();

const octpServiceGlobalOption: ZAxiosOption = {
  config: {
    baseURL: baseApiUrl,
    timeout: 1000,
  },
  fieldConfig: {
    resultField: "data",
    tokenField: "x-auth-token",
  },
  urlPrefix: "/v1",
  trailingTime: true,
  carryToken: true,
};

export const octpHttp = createAxios(octpServiceGlobalOption);
